<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>中软国际办公自动化管理系统</title>
		<link href="<%=request.getContextPath() %>/css/style.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
			function checkClaimVoucher(checkResult){
		   		if(!confirm('确定'+checkResult+'报单吗')) return;
		   		document.getElementById("result").value = checkResult;
		   		document.checkResultForm.submit();
		   		
		   	}
		</script>
	</head>
<body>
    <div class="action  divaction">
    	<div class="t">审核报销单</div>
   		<div class="pages">
        	<!--增加报销单 区域 开始-->
            <table width="90%" border="0" cellspacing="0" cellpadding="0" class="addform-base">
                <caption>基本信息</caption>
                <tr>
                    <td >编&nbsp;&nbsp;号：${voucher.id}</td>
                    <td>填&nbsp;写&nbsp;人：${voucher.CEmployee.name}</td>
                    <td>部&nbsp;&nbsp;门：${voucher.CEmployee.department_id}</td>
                    <td>职&nbsp;&nbsp;&nbsp;&nbsp;位：${voucher.CEmployee.position}</td>
                </tr>
                <tr>
                    <td>总金额：${voucher.total_account}</td>
                    <td>填报时间：<fmt:formatDate value="${voucher.create_time}" pattern="yyyy-MM-dd"></fmt:formatDate> </td>
                    <td>状态：${voucher.status}</td>
                    <td>待处理人：${voucher.NEmployee.name}</td>
                </tr>
                <tr>
                    <td colspan="4"><p>-------------------------------------------------------------------------------</p></td>
                </tr>
            </table>
          <p>&nbsp;</p>
            <table width="90%" border="0" cellspacing="0" cellpadding="0" class="addform-base">
                <tr>
                    <td>项目类别</td>
                    <td>项目金额</td>
                    <td>费用说明</td>
                </tr>

                <c:forEach var="detail" items="${voucher.detailList}">
                    <tr>
                        <td>${detail.item}</td>
                        <td>￥${detail.account}</td>
                        <td>${detail.des}</td>
                    </tr>
                </c:forEach>
            </table>
      <p>&nbsp;</p>
      <p>-------------------------------------------------------------------------------</p>

            <table width="90%" border="0" cellspacing="0" cellpadding="0" class="addform-base">
                <c:forEach var="result" items="${voucher.resultList}">
                    <tr>
                        <td width="27%">${result.checker_sn}(职位)</td>
                        <td width="20%"><fmt:formatDate value="${result.check_time}" pattern="yyyy-MM-dd"></fmt:formatDate></td>
                        <td width="38%">审核：<span class="red"><strong>${result.result}</strong></span></td>
                    </tr>
                    <tr>
                        <td>审核意见：<strong>${result.comm}</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="3">
                            <p>-------------------------------------------------------------------------------</p>
                        </td>
                    </tr>
                </c:forEach>

            </table>
    <form action="checkResult" name="checkResultForm" method="post">
    <table width="90%" border="0" cellspacing="0" cellpadding="0" class="addform-base">
		<tr>
			<td>
				审批意见：
			</td>
		</tr>
		<tr>
			<td>
				<textarea name="comm" id="textarea" cols="45"
					rows="5"></textarea>
			</td>
		</tr>
		 <!--表单提交行-->
		 <tr>
			<td colspan="3" class="submit">
				<input type="button" name="button" id="button" value="审批通过"
					class="submit_01" onclick="checkClaimVoucher('通过')" />
				<input type="hidden" id="claimId" name="claim_id" value="${voucher.id}"/>
                <input type="hidden" id="result" name="result" value=""/>
                <input type="hidden" name="totalCount" value="${voucher.total_account}"/>
				<c:if test='${sessionScope.employee.name_cn!="财务"}'>
					<input type="button" name="button" id="button" value="审批拒绝"
						class="submit_01" onclick="checkClaimVoucher('拒绝')" />
					<input type="button" name="button" id="button" value="打回"
						class="submit_01" onclick="checkClaimVoucher('打回')" />
				</c:if>
			</td>
		 </tr>
	</table>
	</form>
    <p>&nbsp;</p>
   
    <p>&nbsp;</p>
    <p><input type="button" value="返回" onclick="window.history.go(-1)" class="submit_01"/></p>       
<!--增加报销单 区域 结束-->
        </div>
    </div>
    
</body>
</html>
